package com.sl.plugin.step.selenium.interceptor;

import com.sl.core.engine.meta.ProcessCompDescriptorService;
import com.sl.core.engine.meta.impl.AbstractProcessCompDescriptor;
import com.sl.core.engine.meta.row.ProcessRowDescriptor;
import lombok.Getter;
import org.apache.hop.core.row.value.ValueMetaString;
import org.openqa.selenium.WebDriver;

import java.util.Map;

/**
 */
@Getter
 public class SeleniumInterceptorCompCompDescriptor extends AbstractProcessCompDescriptor<
        SeleniumInterceptorComp,SeleniumInterceptorCompContext> implements ProcessCompDescriptorService {


    @Override
    public void loadDescriptor(Map<String, Object> map) {
        excludeSerializableClass.add(WebDriver.class);
    }


    @Override
    public ProcessRowDescriptor getResultDescriptor(ProcessRowDescriptor rowDescriptor) {
        rowDescriptor.clear();
        rowDescriptor.addValueMeta(new ValueMetaString("url"));
        rowDescriptor.addValueMeta(new ValueMetaString("webDriver"));
        rowDescriptor.addValueMeta(new ValueMetaString("content"));
        return rowDescriptor;
    }
}
